package com.kexinde.wjifen.model;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;

/**
 * 
 * @author wei
 *	
 *	店铺积分
 *
 */
@Entity
public class ShopPoint {
	
	private long id;  // 编号（主键）
	private Shop shop;  // 商店
	private NormalUser normalUser;  // 普通用户
	private long point;  // 积分
	
	public ShopPoint(){}

	@Id
	@GeneratedValue
	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	@ManyToOne(cascade=CascadeType.ALL)
	public Shop getShop() {
		return shop;
	}

	public void setShop(Shop shop) {
		this.shop = shop;
	}

	@ManyToOne(cascade=CascadeType.ALL)
	public NormalUser getNormalUser() {
		return normalUser;
	}

	public void setNormalUser(NormalUser normalUser) {
		this.normalUser = normalUser;
	}

	public long getPoint() {
		return point;
	}

	public void setPoint(long point) {
		this.point = point;
	}

	@Override
	public String toString() {
		return "ShopPoint [id=" + id + ", shop=" + shop + ", normalUser="
				+ normalUser + ", point=" + point + "]";
	}
	
}
